<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="b" uri="/bbs-tags"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>My JSP 'viewPost.jsp' starting page</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">

		<link rel="stylesheet" type="text/css" href="css/pageStyleOne.css">
		<link rel="stylesheet" type="text/css" href="css/viewPost.css">
		<link rel="stylesheet" type="text/css" href="css/header.css">

		<!--[if lt IE 7]> 
	<script type="text/javascript" src="js/ie6png.js"></script>
	<![endif]-->
		<script type="text/javascript" src="js/parseIcon.js">
</script>
		<script type="text/javascript" src="js/jquery.js">
</script>
<script type="text/javascript">
	function setState()
	{
	document.stateForm.action="setPostStateAction";
	stateForm.submit();
	return true;
	}
</script>


	</head>

	<body onload="parseIcon()">
		<div id="container">
			<%@ include file="styleJsp/header.jsp"%>
			<!-- 中部 -->
			<div id="content">
				<div id="contentCenterTop">
					<div id="contentCenterTop1">
						<a
							href="getRightListAction_getPostRightList?boardId=<s:property value="post.board.boardId"/>"><img
								src="images/post_btn.png" /> </a>
					</div>
					<div id="contentCenterTop3">
						${pagination}
					</div>
				</div>
				<div id="contentCenter">
					<div id="contentCenterTitle">
						<div id="contentCenterTitleLeft">
							<div id="contentCenterTitleLeft0">
								<span class="contentCenterTitleLeft1">查看:</span>
								<span class="contentCenterTitleLeft2"> <!-- 帖子点击率 --> <s:property
										value="post.postClick" /> </span>
								<span class="contentCenterTitleLeft1">|</span>
								<span class="contentCenterTitleLeft1">回复:</span>
								<span class="contentCenterTitleLeft2"> <!-- 帖子回复数 --> <s:property
										value="post.postReply" /> </span>
							</div>
						</div>
						<div id="contentCenterTitleRight">
							<span class="contentCenterTitleRight1"> <!-- 帖子名称 --> <s:property
									value="post.postName" /> </span>
							<span class="contentCenterTitleRight2"> <!-- 帖子状态 --> <b:postIcon
									type="2" state="${post.postState}" /> </span>
							<span class="contentCenterTitleRight3"><a
								href="deletePostAction?postId=<s:property value='post.postId'/>&boardId=<s:property value="post.board.boardId"/>">删除</a>
							</span>
							
							<form action="" method="post" name="stateForm" >
								<input type="hidden" name="postId" value="<s:property value='post.postId'/>" />
								<span class="contentCenterTitleRight4"><select
										name="postState" onchange="setState()">
										<option value="0">
											设置状态
										</option>
										<option value="1">
											精华帖
										</option>
										<option value="2">
											必火帖
										</option>
										<option value="3">
											推荐帖
										</option>
									</select> </span>
							</form>
						</div>
					</div>
					<s:iterator value="list" status="st">
						<div class="contentCenterMain">
							<div class="contentCenterMainTop">
								<div class="contentCenterMainTopLeft">
									<!-- 用户名 -->
									<span class="contentCenterMainTopLeft1"><s:property
											value="user.userName" /> </span>
								</div>
								<div class="contentCenterMainTopRight">
									<span class="contentCenterMainTopRight1"><img
											src="images/o1.gif" /> </span>
									<span class="contentCenterMainTopRight1">发表于</span>
									<span class="contentCenterMainTopRight1"> <!-- 日期 --> <b:showTime
											oldTime="${postDate}" /> </span>
									<span class="contentCenterMainTopRight2"> <!-- 楼的层次判断（显示逻辑） -->
										<s:if test="(#st.index+(pageNo-1)*10)==0">楼主</s:if> <s:elseif
											test="(#st.index+(pageNo-1)*10)==1">沙发</s:elseif> <s:elseif
											test="(#st.index+(pageNo-1)*10)==2">板凳</s:elseif> <s:elseif
											test="(#st.index+(pageNo-1)*10)==3">地板</s:elseif> <s:else>
											<s:property value="%{#st.index+(pageNo-1)*4}" />#</s:else> </span>
								</div>
							</div>

							<div class="contentCenterMainBottom">
								<div class="contentCenterMainBottomLeft">
									<!--头像  -->
									<span class="contentCenterMainBottomLeft1"><a
										href="blogIndex.jsp?userId=<s:property value='user.userId' />"><img
												src="files/<s:property value='user.userInfo.images'/>" width="120" height="120" /> </a> </span>	
								</div>
								<div class="contentCenterMainBottomRight">
									<div class="contentCenterMainBottomRight1">
										<!-- 内容 -->
										<s:property value="postContent" />
									</div>
									<div class="contentCenterMainBottomRight2">
										<a href="#"> <span class="contentCenterMainBottomRight2-1"><span
												class="contentCenterMainBottomRight2-1-1"><img
														src="images/huifu1.gif" /> </span><span
												class="contentCenterMainBottomRight2-1-2">回复</span> </span> </a>
										<a href="#"> <span class="contentCenterMainBottomRight2-1"><span
												class="contentCenterMainBottomRight2-1-1"><img
														src="images/yinyong1.gif" /> </span><span
												class="contentCenterMainBottomRight2-1-2">引用</span> </span> </a>
									</div>
								</div>
							</div>

						</div>
					</s:iterator>
				</div>
				<div id="contentCenterTop">
					<div id="contentCenterTop1">
						<a
							href="getRightListAction_getPostRightList?boardId=<s:property value="post.board.boardId"/>"><img
								src="images/post_btn.png" /> </a>
					</div>
					<div id="contentCenterTop3">
						${pagination}
					</div>
				</div>
				<div id="post_edit">
					<form action="replyPostAction" method="post">
						<div id="post_Title">
							<span id="post_Title1">回复帖子</span>
						</div>
						<input type="hidden" name="postId"
							value="<s:property value='post.postId'/>">
						<!-- 编辑框 -->
						<div style="float: left; margin: 10px 0 0 20px">
							<b:editTable height="160" width="930" />
						</div>
						<input id="post_btn" type="image" src="images/post_btn1.jpg">
					</form>
				</div>
			</div>
			<div id="footerBottom">
				<span>本项目由《我爱软件小组》开发制作-2011</span><span><a href="#">关于我们</a>
				</span><span>-</span><span><a href="index">首页</a> </span><span>The
					project design by 《I Love Software》-2011</span>
			</div>
		</div>
	</body>
</html>
